/*  

Cafechess Library: Cover basic chess programming needs, like GUI, Engine integration, 
FEN and PGN parsing.

                 \\|//
                 (o o)
--------------ooO-(_)-Ooo----------------------------------
Copyright (C) 2009  By Gregory A. Prentice Snoqualmie, WA
                    www.cafechess.org
                    cafechess@comcast.net
                      Oooo
--------------oooO----(  )---------------------------------
              (  )    (_/
               \_)

Microsoft Public License (Ms-PL)
               
Revisions:

Author        Date    Description:

*/
using System;
using System.Drawing;
using System.Collections;


namespace Cafechess.Imaging

{
  /// <summary>
  /// Used as a container of other layers which all eventually draw
  /// themselves onto this layers.
  /// </summary>
  public class Surface : Layer
  {
 
    /// <summary>
    /// Construct our surface object that will manage the physical drawing bitmap
    /// and the order in which our layers are applied to the image.
    /// </summary>
    /// <param name="rectangle"></param>
    public Surface(Rectangle rectangle, Color background) : base(rectangle,background)
    {
    }
    /// <summary>
    /// Default constructor which constructs our surface object 
    /// that will manage the physical drawing bitmap
    /// and the order in which our layers are applied to the image.
    /// </summary>
    public Surface() : base()
    {
    }

    #region Methods
    /// <summary>
    /// Adds a drawable item to our layer.  Uses the name of the IDrawable
    /// interface to ensure only one with this name is added.
    /// </summary>
    /// <param name="iDraw"></param>
    /// <returns>True if added to the layer, false means an item by this name exists</returns>
    public void Layer(Layer aLayer)
    {
      base.Add(aLayer);
    }
    /// <summary>
    /// Retrieve a layer based on an index.
    /// </summary>
    /// <param name="ndx"></param>
    /// <returns></returns>
    public Layer Layer(int ndx)
    {      
      return base.Get(ndx) as Layer;
    }
    #endregion Methods
  }

}
